﻿namespace Library.OrmEnterpriseEntity {
	public class QueryExpWrapBuilder : QueryExpBuilder {
		public readonly QueryExpBuilder First;
		public readonly QueryExpBuilder Second;
		public readonly ExpressionOperator Operator;
		private readonly bool _forceFire;

		public QueryExpWrapBuilder(QueryExpBuilder first, ExpressionOperator expressionOperator, QueryExpBuilder second) {
			First = first;
			Second = second;
			Operator = expressionOperator;
			Statement = first.Statement;
			second.Statement = Statement;
			_forceFire = true;
		}
		protected override void OnStatementChanged() {
			base.OnStatementChanged();
			if (!_forceFire) return;
			First.Statement = Statement;
			Second.Statement = Statement;
		}
	}
}
